﻿package net.wangit.email;

import org.apache.commons.mail.SimpleEmail;

public class EmailSender {

	public EmailSender() {
	}

	public static void send(String to, String from, String fromName,
			String subject, String msg) throws Exception {
		SimpleEmail email = new SimpleEmail();
		email.setHostName(EmailSettings.getHost());
		email.setAuthentication(EmailSettings.getUser(), EmailSettings
				.getPassword());
		email.setCharset(EmailSettings.getCharset());
		email.addTo(to);
		email.setFrom(from, fromName);
		email.setSubject(subject);
		email.setMsg(msg);
		email.send();
	}
}
